#ifndef SYNCHROQUEUE_H
#define SYNCHROQUEUE_H

#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>

#include "gdsl_queue.h"

class SynchroQueue
{
    public:
        SynchroQueue();
        SynchroQueue(int MaxQueSize);

        virtual ~SynchroQueue();

        void add(void *data);
        bool addIfPossible(void *data);
        void *addAndGetIfFull(void *data);
        void *get();

        int getSize() { return queSize; }
        int getMaxSize() { return queSizeThreshold; }
        bool getSourceIsFinished() { return sourceIsFinished; }
        void setSourceIsFinished() { sourceIsFinished = true; }
    protected:
        //std::list<_DataType> queData();
        gdsl_queue_t gQueue;
        int queSize;
        int queSizeThreshold;
        bool sourceIsFinished;

        pthread_mutex_t mtxQue;
    private:
};


#endif // SYNCHROQUEUE_H
